#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int main()
{
	char str[1000] = { 0 };
	gets(str);
	int len = strlen(str);
	int English = 0;
	int blank = 0;
	int figure = 0; 
	int other = 0;
	for (int i = 0; i < len; i++)
	{
		if ((str[i]>='a'&&str[i]<='z') || (str[i]>='A'&&str[i] <= 'Z'))
		{
			English++;
		}
		else if (str[i]>='0'&&str[i]<='9')
		{
			figure++;
		}
		else if (str[i] == ' ')
		{
			blank++;
		}
		else
		{
			other++;
		}
	}
	printf("%d %d %d %d", English, figure, blank, other);
	return 0;
}